﻿using System;
using System.Collections.Generic;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;

namespace QuanLyPhongMach.Model
{
    [Table(Name="NguoiDung")]
    public class CNguoiDung
    {
        #region Properties
        [Column(Name = "ID", IsPrimaryKey = true)]
        public string ID { get; set; }

        [Column(Name = "MatKhau")]
        public string MatKhau { get; set; }

        [Column(Name = "MaPhanQuyen")]
        public int MaPhanQuyen { get; set; }
        #endregion

        #region Constructor
        public CNguoiDung() { }

        public CNguoiDung(string id, string matkhau, int maphanquyen)
        {
            Initialize(id, matkhau, maphanquyen);
        }

        public CNguoiDung(string id, string matkhau)
        {
            Initialize(id, matkhau, 0);
        }

        public CNguoiDung(string id, int maphanquyen)
        {
            Initialize(id, "", maphanquyen);
        }

        public void Initialize(string id, string matkhau, int maphanquyen)
        {
            this.ID = id;
            this.MatKhau = matkhau;
            this.MaPhanQuyen = maphanquyen;
        }
        #endregion
    }
}
